Module reference - for loop

In a for loop I normally use:

Object o = null

for o in (current Module) do {

...

}

 

How can I use the for loop to iterate through another module in the current project?  All examples I have seen refer to only the current module and not another module in the project.

Thanks,

Derk

 

 


Derk11 - Thu Apr 18 10:02:44 EDT 2013

Re: Module reference - for loop
llandale - Thu Apr 18 10:34:38 EDT 2013

The "examples" are just that.  Realistically the above loop "should" look like this:

  • Module mod = current
  • for o in mod do{}

This lets you use the module handle for something else later in the code.

As for other modules, it would generally look like this:

  • Module mOther = read(FullName_OtherModule, false, true)
  • for oOther in mOther do{}
  • close(mOther)

-Louie

Browse the DXL forums for "current Module" and you should find good arguments against using that.

Re: Module reference - for loop
Derk11 - Thu Apr 18 14:03:48 EDT 2013

llandale - Thu Apr 18 10:34:38 EDT 2013

The "examples" are just that.  Realistically the above loop "should" look like this:

  • Module mod = current
  • for o in mod do{}

This lets you use the module handle for something else later in the code.

As for other modules, it would generally look like this:

  • Module mOther = read(FullName_OtherModule, false, true)
  • for oOther in mOther do{}
  • close(mOther)

-Louie

Browse the DXL forums for "current Module" and you should find good arguments against using that.

Thanks Louie that works.